]
where
safem = case m of
- AUTH u _ -> AUTH u nullAuthToken
+ AUTH u _ -> AUTH u displayAuthToken
_ -> m
ConnIdent mident = connIdent conn
{- authentication tokens
-
- - Copyright 2016 Joey Hess <id@joeyh.name>
+ - Copyright 2016-2025 Joey Hess <id@joeyh.name>
-
- License: BSD-2-clause
-}
toAuthToken,
fromAuthToken,
nullAuthToken,
+ displayAuthToken,
genAuthToken,
AllowedAuthTokens,
allowedAuthTokens,
nullAuthToken :: AuthToken
nullAuthToken = AuthToken $ secureMemFromByteString $ TE.encodeUtf8 T.empty
+-- | Display in place of a real AuthToken in protocol dumps.
+displayAuthToken :: AuthToken
+displayAuthToken = AuthToken $ secureMemFromByteString $ TE.encodeUtf8 $ T.pack "<AUTHTOKEN>"
+
-- | Generates an AuthToken of a specified length. This is done by
-- generating a random bytestring, hashing it with sha2 512, and truncating
-- to the specified length.